//
//  MallController.swift
//  flowerpot
//
//  Created by fyname on 15/9/18.
//  Copyright © 2015年 senhe. All rights reserved.
//

import UIKit

class MallController: UIViewController {
    
    var detailURL = "http://www.baidu.com"
    
     @IBOutlet var mall: UIWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        mall.frame = view.bounds
        let url = NSURL(string: detailURL)
        let request = NSURLRequest(URL: url!)
        mall.loadRequest(request)
        self.view.addSubview(mall)
        
        // Do any additional setup after loading the view.
        
        //禁止了自动约束。然后我们对webview的宽和高添加了约束。这样webview就会和它的superview拥有一样的宽和高了。
        let height = NSLayoutConstraint(item: mall, attribute: .Height, relatedBy: .Equal, toItem: view, attribute: .Height, multiplier: 1,constant: 0)
        let width = NSLayoutConstraint(item: mall, attribute: .Width, relatedBy: .Equal, toItem: view, attribute: .Width, multiplier: 1, constant: 0)
        view.addConstraints([height, width])
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

   
    
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
